import { createRouter, createWebHistory } from "vue-router";
import Login from "@/views/login/index.vue";
import Layout from "@/views/layout/index.vue";
// import User from '@/views/user/index.vue'
// import Sort from '@/views/sort/index.vue'
import Index from "@/views/index/index.vue";
// import Supplier from '@/views/supplier/index.vue'

// import { ref,watch } from 'vue'
// import { useRoute } from 'vue-router';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      component: Layout,
      children: [
        { path: "/", redirect: "/index" },
        { path: "/index", name: "首页", component: Index },
        // { path: "/user", name: "用户管理", component: User },
        // { path: "/sort", name: "商品分类管理", component: Sort },
        // { path: "/supplier", name: "供应商管理", component: Supplier },
      ],
    },
    {
      path: "/login",
      component: Login,
    },
  ],
});

export default router;
